package com.wgz.flag.mapper;

import com.wgz.flag.entity.GroupMember;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.time.LocalDateTime;

@Mapper
public interface GroupMemberMapper {
    void insert(GroupMember member);

    List<GroupMember> selectByGroupId(Long groupId);

    GroupMember selectByGroupAndUserId(@Param("groupId") Long groupId, @Param("userId") Long userId);

    void updateStatus(@Param("groupId") Long groupId, @Param("userId") Long userId, @Param("status") Integer status);

    void updateRole(@Param("groupId") Long groupId, @Param("userId") Long userId, @Param("role") Integer role);

    void updateMuteTime(@Param("groupId") Long groupId, @Param("userId") Long userId,
            @Param("muteEndTime") LocalDateTime muteEndTime);

    List<Long> selectMemberIdsByGroupId(@Param("groupId") Long groupId);

    void insertBatch(List<GroupMember> members);
}